
module.exports = {
  description: '创建组件',
  prompts: [
    {
      type: 'input',
      name: 'name',
      message: '输入组件文件名',
      validate: function(val) {
        return val !== ''
      }
    }
  ],
  actions: function(data) {
    const { name } = data
    const actions = [{
      type: 'add',
      path: `src/components/${name}/index.vue`,
      templateFile: 'template/component/component.hbs',
      data: {
        name: '{{name}}'
      }
    }]
    return actions
  }
}
